/**
 * 出库申请api
 */
import request from '@/utils/request'

const BASE = '/wms/store-out-apply'

/**
 * 分页查询
 * @param {*} query
 * @returns
 */
export function page(query) {
  return request({
    url: BASE + '/page-list',
    method: 'POST',
    data: query
  })
}

/**
 * 保存出库申请
 * @param {*} query
 * @returns
 */
export function save(data) {
  return request({
    url: BASE + '/saveOutApply',
    method: 'POST',
    data
  })
}

/**
 * 出库申请明细
 * @param {*} data
 * @returns
 */
export function detail(id) {
  return request({
    url: BASE + `/detail/${id}`,
    method: 'GET'
  })
}

/**
 * 删除出库申请
 * @param {number} id
 * @returens
 */
export function deleteById(id) {
  return request({
    url: BASE + `/delete/${id}`,
    method: 'GET'
  })
}

/**
 * @param {*} data
 * @returns
 */
export function audit(data) {
  return request({
    url: BASE + '/audit',
    method: 'POST',
    data
  })
}
/**
 * 批量审批出库计划
 *
 * @param {*} data
 */
export function batchAudit(data) {
  return request({
    url: BASE + '/batch-audit',
    method: 'POST',
    data
  })
}
export function deleteoutApply(id) {
  return request({
    url: BASE + '/delete/' + id,
    method: 'get'

  })
}
